package com.hsl.test.utils;

import com.alibaba.druid.pool.DruidDataSource;

/**
 * @author hsl
 * @Data 2021/12/14
 * @Desc 数据源配置工具类
 */
public class DruidUtil {
    private DruidUtil() {
    }
    private static DruidDataSource dataSource = new DruidDataSource();
    static {
        //驱动
        dataSource.setDriverClassName("com.mysql.jdbc.Driver");
        //URL
        dataSource.setUrl("jdbc:mysql:///test");
        dataSource.setUsername("root");
        dataSource.setPassword("root");
    }
    public static DruidDataSource getInstance(){
        return dataSource;
    }
}
